package com.hello.booksale.dao;

import com.hello.booksale.entity.BookEntity;
import com.hello.booksale.entity.OrderEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

public interface OrderDao {

    @Select("SELECT * FROM `order` WHERE user_name=#{userName}")
    List<OrderEntity> selectOrderByUserName(@Param("userName") String userName);

    @Insert("INSERT INTO `order` (user_name,book_num,book_url,book_name,book_price,book_author) VALUES (#{userName},#{bookNum},#{bookUrl},#{bookName},#{bookPrice},#{bookAuthor})")
    void insertOrder(OrderEntity orderEntity);

}
